package com.sali.handler;

import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @description:
 * @author: sali
 * @date: 2025/2/21 下午11:22.
 * @version: 1.0
 */
@Slf4j
public class MessageStatistics {

    private MessageStatistics() {
    }

    /**
     * 接受报文变量
     */
    private static AtomicLong sendMsgCount = new AtomicLong(0);

    public static AtomicLong getSendMsgCount() {
        return sendMsgCount;
    }

    /**
     * 打印报文统计信息
     */
    public static void print() {
        log.warn("current time:{}, message receive count is :{}", DateUtil.now(), sendMsgCount.get());
    }

}
